package com.lagou.util;

import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;

@Activate(group = {CommonConstants.CONSUMER})
public class TransportIpFilter implements Filter {
    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        // 保存IP地址信息
        DubboTraffic.saveFrom(WebRequestHodler.request());
        System.out.println("TransportIpFilter---->" + WebRequestHodler.request());
        return invoker.invoke(invocation);
    }
}
